
<@css href="/easyui/themes/default/easyui.css"/>
<@css href="/easyui/themes/icon.css"/>
<@js src="/easyui/jquery.easyui.min.js"/>
<@js src="/easyui/locale/easyui-lang-zh_CN.js"/><@jsRender/>
<div class="detailsBox">
	<div class="detaiTab">
	<form class="action-ajax-form" action="/loanrest/save_sponsor" method="post" onsubmit="return onSubmitApply();">
		<table width="100%">
		<tr><span style="color:red">申请担保人之前请先查询征信报告(如担保人无征信报告则不能添加为担保人)</span></tr>
		<tr width="70%">
		<td width="10%" align="right" class="bg">担保人姓名：
		</td>
		
		<td width="20%">
		<!--
		 <@autocomplete url="${crmurl}" name="keywords" id='keywords' class="action-valid-field" style="min-width:200px; width:auto; white-space:nowrap; " 
			hideIdName="customerId" />  (联想) <a href='/sponsorInfo/rest/add-view?loanapplyNo=${loanapplyNo}' class="action-ajax-btn">添加担保人</a>
		-->
		<input type="test" class="easyui-combogrid" name="zxid"  id="zxid" style="width:250px;" ></input>
		</td>
		<td width="40%"><a class="btn_auto_30 btn_yellow ml20" href="/o2ozx/index" target="_blank">申请担保人征信</a></td>
		</tr>
	   <tr width="70%">
	   <td width="30%" align="right" class="bg">与借款人关系:</td>
		<td width="40%">
			<select name="relationshipBorrower">
				<option>朋友</option>
				<option>亲戚</option>
				<option>直系亲戚</option>
			</select>
			<span><font color="red">*</font></span> 
		</td>
		</tr>
		</table>
		<div style='margin:10px auto; text-align:center'>
			<input type="hidden" name="loanapplyNo" value=${loanapplyNo}>
			<input type="submit" class="btn_auto_30 btn_blue" value="保存">
		</div>
		</form>
</div>
</div>

<script type="text/javascript">

function onSubmitApply(){
	var _keywords = checkInput('keywords');
	if(_keywords){
		return true;
	}
	return false;
}

function checkInput(id){
	if(id=="keywords"){
		var keywords = $("input[name='"+id+"']").val();
		if(keywords==""){
			errorMsg("",id+"Erorr","没有选中担保人，请重新选中");
			return false;
		}else{
			errorMsg("",id+"Erorr","");
		}
	} 
	return true;
}

$(document).ready(function(){
	$.ajaxSetup ({     
		cache: false //设置成false将不会从浏览器缓存读取信息
	});
$('#zxid').combogrid({
		loadMsg:'数据加载中,请稍后...',
		panelWidth: 600,
		idField: 'zxid',
		textField: 'userfullname',
		url: '/oaoro2odatasub/jsonwordzx',
		method: 'post',
		 pagination : true,//是否分页
		 rownumbers:true,//序号   
      collapsible:false,//是否可折叠的   
      fit: true,//自动大小   
      pageSize: 10,//每页显示的记录条数，默认为10   
      pageList: [10],//可以设置每页记录条数的列表 
		columns: [[
			
			{field:'billcode',title:'征信单椐',width:150},
			{field:'userfullname',title:'但保人',width:100},
			{field:'documentno',title:'证件号码',width:160},
			{field:'zxdate',title:'银行征信报告日期',width:130},
			{field:'zxtddate',title:'第三方征信报告日期',width:130}
		]],
		fitColumns: true,
		delay: 1000,
		keyHandler: {
			up: function() {
			},
			down: function() {
			},
			enter: function() {
			},
			query: function(q) {
					$('#zxid').combogrid("grid").datagrid("reload", { 'reloadname': q });
					$('#zxid').combogrid("setValue", q);
					
			}
		 }
	});
});
</script>

